note
	description: "Summary description for {FACTORY}."
	author: ""
	date: "$Date$"
	revision: "$Revision$"

class
	FACTORY

create
	make

feature {ANY}

	taille: INTEGER

	elementstype: HASH_TABLE [STRING, STRING]

	arrayelement: HASH_TABLE [ARRAYED_LIST [STRING], STRING]

	make (listelement: HASH_TABLE [STRING, STRING]; listetable: HASH_TABLE [ARRAYED_LIST [STRING], STRING]; size: INTEGER)
		do
			elementstype := listelement
			arrayelement := listetable
			taille := size
		end

	creer_item (values: HASH_TABLE [STRING, STRING]): ITEM
		local
			noms : ARRAY[STRING]
			i: INTEGER
			entier: INTEGER
			listeChaine: HASH_TABLE [STRING, STRING]
			listeEntier: HASH_TABLE [INTEGER, STRING]
			nomCourant: STRING
			valCourante: STRING
			retour: ITEM
		do
						noms := values.current_keys
			create listeChaine.make (100)
			create listeEntier.make (100)
			from
				i := 1
			until
				i > noms.count
			loop
					--attention danger
				nomcourant := noms.at (i)
				valcourante := values.at (nomcourant)
			--	print (nomcourant + " " + valcourante + " f")
				if elementstype.item (nomcourant).is_equal ("INTEGER") then
					entier := valcourante.to_integer_32
					listeEntier.put (entier, nomcourant)
				elseif elementstype.item (nomcourant).is_equal ("STRING") then
					listeChaine.put (valcourante, nomcourant)
				end
				i := i + 1
			end
			create retour.make (listeentier, listechaine, arrayelement, elementstype)
			Result := retour
		end

end
